# -*- coding: utf-8 -*-

import Image
import os
import glob

for infile in glob.glob(os.path.abspath(".")+"\\*.bmp"):
    f, e = os.path.splitext(infile)
    outfile = f + ".png"
    if infile != outfile:
        try:
            Image.open(infile).save(outfile)
        except IOError:
            print ("cannot convert", infile)